import sys
import os

# 确保路径正确添加
site_packages_path = os.path.join(os.environ['CONDA_PREFIX'], 'lib', 'site-packages')
sys.path.append(site_packages_path)
print(sys.path)

try:
    import quafu
    print(f"quafu 模块路径: {quafu.__file__}")
except ModuleNotFoundError as e:
    print(f"无法导入 quafu 模块: {e}")

def main():
    try:
        # 尝试创建一个简单的量子电路
        circuit = quafu.QuantumCircuit(2)
        circuit.h(0)
        circuit.cx(0, 1)
        print("quafu 安装并正常工作！")
    except Exception as e:
        print(f"发生错误: {e}")

if __name__ == "__main__":
    main()